var express = require('express')
var router = require('./router')
var bodyParser = require('body-parser')


var app = express()



//开放node_modules和public(views不用开发了，art-template渲染默认views为根目录)
app.use('/node_modules', express.static('./node_modules'))
app.use('/public', express.static('./public'))

//配置bodyparser
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())

//配置express-art-template(记得放在express()后面)
app.engine('html', require('express-art-template'))

app.use(router)
 
app.listen(3000, function(){console.log('服务器启动成功~')})